package cn.cdeden.aiqa.dubbo;

import cn.cdeden.aiqa.domain.ExpertApp;
import cn.cdeden.aiqa.service.ExpertAppService;
import cn.cdeden.common.core.utils.MapstructUtils;
import cn.cdeden.system.api.RemoteExpertAppService;
import cn.cdeden.system.api.domain.bo.RemoteExpertAppBo;
import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

@RequiredArgsConstructor
@Service
@DubboService
public class RemoteExpertAppServiceImpl implements RemoteExpertAppService {

    private final ExpertAppService expertAppService;

    @Override
    public RemoteExpertAppBo getRemoteExpertApp() {
        ExpertApp remoteExpertApp = expertAppService.getRemoteExpertApp();
        return MapstructUtils.convert(remoteExpertApp, RemoteExpertAppBo.class);
    }

    @Override
    public RemoteExpertAppBo getDataBaseIdByUserId(Long userId) {
        ExpertApp dataBaseIdByUserId = expertAppService.getDataBaseIdByUserId(userId);
        return MapstructUtils.convert(dataBaseIdByUserId, RemoteExpertAppBo.class);
    }
}
